import Layout from '@/pages/layout'
import Login from '@/pages/login'
import Test from '../pages/test'
import Detail from '@/pages/detail'
import Search from '@/pages/search'
import SearchResult from '@/pages/search/Result'

// 导入子页面
import Home from '@/pages/home'
import Profile from '@/pages/profile'
import Question from '@/pages/question'
import Video from '@/pages/video'

import ProfileEdit from '@/pages/profile/Edit'

const routes = [
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/',
        element: <Home />,
      },
      {
        path: '/profile',
        element: <Profile />,
      },
      {
        path: '/question',
        element: <Question />,
      },
      {
        path: '/video',
        element: <Video />,
      },
    ],
  },
  {
    path: '/search',
    element: <Search />,
  },
  {
    path: '/search/result',
    element: <SearchResult />,
  },
  {
    path: '/article/:id',
    element: <Detail />,
  },
  {
    path: '/login',
    element: <Login />,
  },
  {
    path: '/test',
    element: <Test />,
  },
  {
    path: '/profile/edit',
    element: <ProfileEdit />,
  },
]

export default routes
